<if condition="!empty($sourcename)">


<div>
    <div id="donut" class="revenue-graph" style="width:300px;float:left"></div>
    <div class="legend" style="width:250px;float:left" >
        <volist name="legend" id='j'>
            <div>
                <i class="fa icon-square pull-left lh32"></i>
                <div class="pull-left">{$j['name']}</div>
                <div class="pull-left" style="margin-left:10px">{$j['sum']}</div>
                <div class="clearfix"></div>
            </div>
        </volist>
    </div>
    <div class="clearfix"></div>
    <script>
            Morris.Donut({
                element: 'donut',
                data: [{$sourcename}],
                backgroundColor: false,
                labelColor: '#25B6B9',
                colors: [
                    '#4acacb', '#6a8bc0', '#5ab6df', '#fe8676', '#D4CCC5','#5ab6df', '#fe8676', '#D4CCC5','#5ab6df'
                ],
                formatter: function (x, data) {
                    return data.formatted;
                }
            });
            var mycolor=new Array('#4acacb', '#6a8bc0', '#5ab6df', '#fe8676', '#D4CCC5','#5ab6df', '#fe8676', '#D4CCC5','#5ab6df');
            $('.legend div').each(function(){
                $(this).addClass('lh32');
                $(this).children('i').css({color:mycolor[$(this).index()],fontSize:'16px'});
            });
 
    </script>
    <style>
        .lh32{line-height:32px;}
    </style>
</div>
<else/>
<div style=" padding:20px; font-size:18px; color:#ccc; line-height:190px; text-align:center;"><div></div>暂无数据</div>

</if>